<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/24/024
 * Time: 20:12
 */

namespace app\admin\validate;

class TaskTypeValidate extends \think\Validate
{

    const SCENE_ADD = 'add'; //添加
    const SCENE_EDIT = 'edit'; //编辑
    const SCENE_REMOVE = 'remove'; //删除数据




    protected $rule = [
        'id' => 'require|number',
        'title' => 'require|max:50',
        'is_check'  =>  'require|integer',
        'reward_type'  =>  'require|integer',
        'op_type'  =>  'require|integer',
        'effective_time'  =>  'require|integer',
        'playtime'  =>  'require|integer',
    ];


    protected $message  = [
        'title.require' => '标题必须',
        'title.max' => '标题最大长度50',
        //'is_hot.require' => '不能为空',

    ];
    
    //场景
    protected $scene  = [
       self::SCENE_ADD => ['title', 'is_check', 'reward_type', 'op_type', 'playtime', 'effective_time'],
       self::SCENE_EDIT => ['id','title', 'is_check', 'reward_type', 'op_type', 'playtime', 'effective_time'],
       self::SCENE_REMOVE => ['id'],
    ];
    
    

}